<?php
/**
 * Created by PhpStorm.
 * User: 12297
 * Date: 2018/5/26
 * Time: 1:19
 */
namespace app\admin\controller;

use app\common\BaseHelper;
use app\common\service\MiniProgramHelp;

class Notice{
    public function Index(){
        $tenantId = session("TENANT_ID");
        $component_access_token = MiniProgramHelp::getAuthorizerToken($tenantId);
        if (empty($component_access_token)) {
            return false;
        }

        $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=' . $component_access_token;
        $postData['offset'] = 0;
        $postData['count'] = 20;

        $result = json_decode(BaseHelper::curlPost($url,json_encode($postData)),true);

        return show('1','ok',$result);

    }
}